package com.yunhe.transfer.client;

import com.yunhe.common.model.DomainList;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@Component
@FeignClient(value = "yh-control"/*, fallbackFactory = AuthorityFallbackFactory.class*/)
public interface ControlClient {

    @RequestMapping(value = "/runStrategies/manualMode", method = RequestMethod.POST)
    ResponseEntity saveManualRunStrategy(@RequestParam("stationCode") Long stationCode,
                                         @RequestBody DomainList<Map<String, Object>> domainList);

    @RequestMapping(value = "/runStrategyLocalHistory", method = RequestMethod.POST)
    ResponseEntity saveLocalHistory(@RequestBody Map<String, Object> map);

    @RequestMapping(value = "/runStrategyHistory", method = RequestMethod.POST)
    ResponseEntity saveRunStrategyHistory(@RequestParam("stationCode") Long stationCode,
                                          @RequestParam("runStrategyName") String runStrategyName,
                                          @RequestParam("controlMode") String controlMode,
                                          @RequestBody Map<String, Object> runStrategyHistory);
}
